package de.hft_stuttgart.dsa.ctt.model;

import java.util.List;

/**
 * @author Ali Yuruz
 */
public abstract class AbstractMatrix implements Cloneable {
	protected Object[][] periodRoomMatrix;
	protected List<Room> rooms;
	protected List<Period> periods;

	public AbstractMatrix(List<Room> rooms, List<Period> periods) {
		super();
		this.rooms = rooms;
		this.periods = periods;
	}

	public Object[][] getPeriodRoomMatrix() {
		return periodRoomMatrix;
	}

	/**
	 * @return the rooms
	 */
	public List<Room> getRooms() {
		return rooms;
	}

	/**
	 * @return the periods
	 */
	public List<Period> getPeriods() {
		return periods;
	}

	public AbstractMatrix clone() throws CloneNotSupportedException {
		AbstractMatrix object = (AbstractMatrix) super.clone();
		return object;
	}
	
	@Override
	public String toString() {
		StringBuffer strBuffer = new StringBuffer(1024);
		int i=0;
		for (Object[] objects : periodRoomMatrix) {
			strBuffer.append("\n");
			strBuffer.append("Period" + i++ + " -> ");
			for (Object o : objects) {
				strBuffer.append(o);
			}
		}
		return strBuffer.toString();
	}
}
